package battleship;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class Database {
	final public static String address = "jdbc:mysql://bungle08.cs.toronto.edu/group28?user=group28&password=leonardo";

	public static Connection open() throws SQLException {
		Connection con = null;
		try {
			Class.forName("com.mysql.jdbc.Driver");
			con = DriverManager.getConnection(address);
		} catch (ClassNotFoundException e) {
		}
		return con;
	}

	public static void close(Connection con) {
		if (con != null) {
			try {
				con.close();
			} catch (SQLException se) {
			}
		}
	}
}
